﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using eNoticeMVC.Models;

namespace eNoticeMVC.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            //ViewData["Message"] = "Welcome to UCS e-Notice Board!";

            if (User.Identity.IsAuthenticated)
            {
                UserProfile profile = UserProfile.GetUserProfile(User.Identity.Name);
 
                ViewData["Message"] = "Hello " + profile.FirstName + " " + profile.LastName + "!";
            }
            else
                ViewData["Message"] = "Welcome to UCS e-Notice Board!";
            return View();
        }

        public ActionResult About()
        {
            return View();
        }
    }
}
